#include <stdafx.h>
#include <iostream>
#include <fstream>
#include <stddef.h>
#include <stdexcept>
#include "blinalg.hpp"
#include "usertypes.hpp"
#include "string.h"
#include "gauss.hpp"
#include "superelement.hpp"
#include "functions.hpp"
#define Max 50
void Intergration(const FElement elem, double *d, int nr_gauss)

{
	double x;
	d[0] = 0.0;
	d[1] = 0.0;
	init_gauss ();

	double a = elem.getVertexCoord(0);
	double b = elem.getVertexCoord(1);
	//
	for(int i = 1; i <= nr_gauss; i ++)
	{
		x = a+(b-a)*xi[i][nr_gauss];
		d[0] += wi[i][nr_gauss]*Function_f(x)*(1.0-xi[i][nr_gauss]);
		d[1] += wi[i][nr_gauss]*Function_f(x)*xi[i][nr_gauss];
	}
	d[0] *= elem.getArea();
	d[1] *= elem.getArea();
}
